
<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <title>{$title}</title>
    <meta name="format-detection" content="telephone=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="viewport" content="width=device-width,initial-scale=1, minimum-scale=1, maximum-scale=1, user-scalable=no" />
    <meta name="description" content="">
    <meta name="keywords" content="">
	<link href="__static__/hry/look/risk_test.css" rel="stylesheet" />
</head>

<body style="background-color:#283847">

	<div class="wrapper">
		<form id="answerFrom" method="post" onsubmit="return false">
    	<div id="answer" class="card_wrap">
			
			{foreach name="$dataList" item="quest" key="k1"}
       	  	<div class="card_cont card{$k1+1}">
            	<div class="card">
                    <p class="question"><span>Q{$k1+1}、</span>{$quest.question}</p>
                    <ul class="select">
						{foreach name="$quest.answer" item="vo" key="k2"}
                        <li>
                            <input id="q{$k1}_{$k2}" type="radio" name="r-group-{$k1}" value="{$vo.score}">
                            <label for="q{$k1}_{$k2}">{$vo.answer}</label>
                        </li>
						{/foreach}
                    </ul>
                    <div class="card_bottom">
					{if condition="$k1+1 eq $totalAll"}
					<button class="layui-btn layui-btn-normal submit">确认提交</button>
						<div class="agree">
							<div class="left">
								<input type="checkbox" id="agress"><label for="agress">我已阅读并同意<br><a href="javaScript:(0)" onclick="tzr()">《投资者声明》</a>
								<a href="javaScript:(0)" onclick="tzrt()">《投资者类型》</a>
							</label>
							</div></div>
					{/if}

					<span><b>{$k1+1}</b>/{$totalAll}</span></div>
                </div>
            </div>
			{/foreach}
    	</div>
		</form>
	</div>
        
    <script src="__static__/hry/look/jquery-1.8.3.min.js"></script>
    <script src="__static__/hry/look/answer.js"></script>
    <script src="__static__/hry/layer/layer.js"></script>
    <script>
	$(function(){
		$("#answer").answerSheet({});
		$('.submit').click(function(){
			var dataFrom = $("#answerFrom").serialize();
			var agree = $('#agress');
			var last_check = $('input[name="r-group-7"]');
			if(!last_check.is(':checked')){
				layer.msg('请填写完整风险评估问卷')
				return false
			}
			if(!agree.is(':checked')){
				layer.msg('尚未同意协议！')
				return false
			}
			$.ajax({
				url:"{:url('Member/assess')}",
				type:"POST",
				dataType:"JSON",
				data:dataFrom,
				success:function(msg){
					if(msg.status == 1){
						layer.alert(msg.info, {
						  skin: 'layui-layer-molv' //样式类名
						  ,closeBtn: 0
						}, function(){
						  window.location.href=msg.url;
						});
					}else{
						layer.alert(msg.info)
					}
				}
			})
		})
	})
	function tzr(){
		layer.open({
			type: 2,
			title: '投资者声明',
			btn: [ '关闭'],
			shadeClose: true,
			shade: 0.8,
			area: ['80%', '90%'],
			content: '{:url("Member/service")}' //iframe的url
		});
	}
	function tzrt(){
		layer.open({
			type: 2,
			title: '投资者类型',
			btn: [ '关闭'],
			shadeClose: true,
			shade: 0.8,
			area: ['80%', '90%'],
			content: '{:url("Member/servicetype")}' //iframe的url
		});
	}

    </script>
</body>
<style>
	.card_bottom{
	 text-align: center;
	}
	.agree {
		margin-top: 20px;
	}
	.layui-btn {
		font-size: 20px;
		height: 38px;
		line-height: 38px;
		outline: none;
		background: #c733c5;
		color: #F0F0F0;
		border: 0;
		padding: 0 20px;
		border-radius: 10px;
	}

	input[type="checkbox"]{
		-webkit-appearance: checkbox;
		box-sizing: border-box;
	}
</style>
</html>
